home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / SoundComponents.a < prev    next >
Text File  |  1996-05-01  |  20KB  |  673 lines

  1. ;
  2. ;    File:        SoundComponents.a
  3. ;
  4. ;    Contains:    Sound Components Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__SOUNDCOMPONENTS__') = 'UNDEFINED' THEN
  19. __SOUNDCOMPONENTS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  25.     include 'Components.a'
  26.     ENDIF
  27.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  28.     include 'Sound.a'
  29.     ENDIF
  30. ;
  31. ;                        * * *  N O T E  * * *
  32. ;
  33. ;    This file has been updated to include Sound Manager 3.1 interfaces.
  34. ;
  35. ;    Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  36. ;    that originally shipped with the PowerMacs. These missing functions and the
  37. ;    new 3.1 interfaces have been released in the SoundLib library for PowerPC
  38. ;    developers to link with. The runtime library for these functions are
  39. ;    installed by Sound Manager 3.1. The following functions are found in SoundLib.
  40. ;
  41. ;        AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  42. ;        AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  43. ;        AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  44. ;        OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  45. ;        SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  46. ;        SoundComponentInitOutputDevice, SoundComponentPauseSource,
  47. ;        SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  48. ;        SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  49. ;        SoundComponentStartSource, SoundComponentStopSource
  50. ;
  51. ;
  52. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  53. ; constants
  54. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. ;sound component types and subtypes
  56. ;
  57.  
  58. kNoSoundComponentType            EQU        '****'
  59. kSoundComponentType                EQU        'sift'                ;component type
  60. kSoundComponentPPCType            EQU        'nift'                ;component type for PowerPC code
  61. kRate8SubType                    EQU        'ratb'                ;8-bit rate converter
  62. kRate16SubType                    EQU        'ratw'                ;16-bit rate converter
  63. kConverterSubType                EQU        'conv'                ;sample format converter
  64. kSndSourceSubType                EQU        'sour'                ;generic source component
  65. kMixerType                        EQU        'mixr'
  66. kMixer8SubType                    EQU        'mixb'                ;8-bit mixer
  67. kMixer16SubType                    EQU        'mixw'                ;16-bit mixer
  68. kSoundOutputDeviceType            EQU        'sdev'                ;sound output component
  69. kClassicSubType                    EQU        'clas'                ;classic hardware, i.e. Mac Plus
  70. kASCSubType                        EQU        'asc '                ;Apple Sound Chip device
  71. kDSPSubType                        EQU        'dsp '                ;DSP device
  72. kAwacsSubType                    EQU        'awac'                ;Another of Will's Audio Chips device
  73. kGCAwacsSubType                    EQU        'awgc'                ;Awacs audio with Grand Central DMA
  74. kSingerSubType                    EQU        'sing'                ;Singer (via Whitney) based sound
  75. kSinger2SubType                    EQU        'sng2'                ;Singer 2 (via Whitney) for Acme
  76. kWhitSubType                    EQU        'whit'                ;Whit sound component for PrimeTime 3
  77. kSoundBlasterSubType            EQU        'sbls'                ;Sound Blaster for CHRP
  78. kSoundCompressor                EQU        'scom'
  79. kSoundDecompressor                EQU        'sdec'
  80. kMace3SubType                    EQU        'MAC3'                ;MACE 3:1
  81. kMace6SubType                    EQU        'MAC6'                ;MACE 6:1
  82. kCDXA4SubType                    EQU        'cdx4'                ;CD/XA 4:1
  83. kCDXA2SubType                    EQU        'cdx2'                ;CD/XA 2:1
  84. kIMA4SubType                    EQU        'ima4'                ;IMA 4:1
  85. kULawSubType                    EQU        'ulaw'                ;µLaw 2:1
  86. kLittleEndianSubType            EQU        'sowt'                ;Little-endian
  87. kAudioComponentType                EQU        'adio'                ;Audio components and sub-types
  88. kAwacsPhoneSubType                EQU        'hphn'
  89. kAudioVisionSpeakerSubType        EQU        'telc'
  90. kAudioVisionHeadphoneSubType    EQU        'telh'
  91. kPhilipsFaderSubType            EQU        'tvav'
  92. ; sound component set/get info selectors
  93.  
  94. siVolume                        EQU        'volu'
  95. siHardwareVolume                EQU        'hvol'
  96. siSpeakerVolume                    EQU        'svol'
  97. siHeadphoneVolume                EQU        'pvol'
  98. siHardwareVolumeSteps            EQU        'hstp'
  99. siHeadphoneVolumeSteps            EQU        'hdst'
  100. siHardwareMute                    EQU        'hmut'
  101. siSpeakerMute                    EQU        'smut'
  102. siHeadphoneMute                    EQU        'pmut'
  103. siRateMultiplier                EQU        'rmul'
  104. siQuality                        EQU        'qual'
  105. siWideStereo                    EQU        'wide'
  106. siHardwareFormat                EQU        'hwfm'
  107. siPreMixerSoundComponent        EQU        'prmx'
  108. siPostMixerSoundComponent        EQU        'psmx'
  109. kOffsetBinary                    EQU        'raw '                ;format types
  110. kTwosComplement                    EQU        'twos'
  111. kMACE3Compression                EQU        'MAC3'
  112. kMACE6Compression                EQU        'MAC6'
  113. ; features flags
  114.  
  115. k8BitRawIn                        EQU        $01                    ;data description
  116. k8BitTwosIn                        EQU        $02
  117. k16BitIn                        EQU        $04
  118. kStereoIn                        EQU        $08
  119. k8BitRawOut                        EQU        $0100
  120. k8BitTwosOut                    EQU        $0200
  121. k16BitOut                        EQU        $0400
  122. kStereoOut                        EQU        $0800
  123. kReverse                        EQU        $00010000            ;  function description
  124. kRateConvert                    EQU        $00020000
  125. kCreateSoundSource                EQU        $00040000
  126. kHighQuality                    EQU        $00400000            ;  performance description
  127. kNonRealTime                    EQU        $00800000
  128.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  129. ; SoundComponentPlaySourceBuffer action flags
  130.  
  131. kSourcePaused                    EQU        $01
  132. kPassThrough                    EQU        $00010000
  133. kNoSoundComponentChain            EQU        $00020000
  134. ; flags for OpenMixerSoundComponent
  135.  
  136. kNoMixing                        EQU        $01                    ;don't mix source
  137. kNoSampleRateConversion            EQU        $02                    ;don't convert sample rate (i.e. 11 kHz -> 22 kHz)
  138. kNoSampleSizeConversion            EQU        $04                    ;don't convert sample size (i.e. 16 -> 8)
  139. kNoSampleFormatConversion        EQU        $08                    ;don't convert sample format (i.e. 'twos' -> 'raw ')
  140. kNoChannelConversion            EQU        $10                    ;don't convert stereo/mono
  141. kNoDecompression                EQU        $20                    ;don't decompress (i.e. 'MAC3' -> 'raw ')
  142. kNoVolumeConversion                EQU        $40                    ;don't apply volume
  143. kNoRealtimeProcessing            EQU        $80                    ;won't run at interrupt time
  144. ; SoundParamBlock quality flags
  145.  
  146. kBestQuality                    EQU        $01                    ;use interpolation in rate conversion
  147. ; useful bit masks
  148.  
  149. kInputMask                        EQU        $000000FF            ;masks off input bits
  150. kOutputMask                        EQU        $0000FF00            ;masks off output bits
  151. kOutputShift                    EQU        8                    ;amount output bits are shifted
  152. kActionMask                        EQU        $00FF0000            ;masks off action bits
  153. kSoundComponentBits                EQU        $00FFFFFF
  154. ; Audio Component constants
  155.  
  156.                                                             ;Values for whichChannel parameter
  157. audioAllChannels                EQU        0                    ;All channels (usually interpreted as both left and right)
  158. audioLeftChannel                EQU        1                    ;Left channel
  159. audioRightChannel                EQU        2                    ;Right channel
  160.                                                             ;Values for mute parameter
  161. audioUnmuted                    EQU        0                    ;Device is unmuted
  162. audioMuted                        EQU        1                    ;Device is muted
  163.                                                             ;Capabilities flags definitions
  164. audioDoesMono                    EQU        $00000001            ;Device supports mono output
  165. audioDoesStereo                    EQU        $00000002            ;Device supports stereo output
  166. audioDoesIndependentChannels    EQU        $00000004            ;Device supports independent software control of each channel
  167. ;
  168. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  169. ; typedefs
  170. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  171. ;
  172. ;
  173. ;ShortFixed consists of an 8 bit, 2's complement integer part in the high byte,
  174. ;with an 8 bit fractional part in the low byte; its range is -128 to 127.99609375
  175. ;
  176. ; typedef short                         ShortFixed
  177.  
  178.  
  179.  
  180. ; typedef SoundParamBlock *                SoundParamBlockPtr
  181.  
  182. SoundParamBlock            RECORD 0
  183. recordSize                 ds.l    1                ; offset: $0 (0)        ; size of this record in bytes
  184. desc                     ds        SoundComponentData ; offset: $4 (4)        ; description of sound buffer
  185. rateMultiplier             ds.l    1                ; offset: $20 (32)        ; rate multiplier to apply to sound
  186. leftVolume                 ds.w    1                ; offset: $24 (36)        ; volumes to apply to sound
  187. rightVolume                 ds.w    1                ; offset: $26 (38)
  188. quality                     ds.l    1                ; offset: $28 (40)        ; quality to apply to sound
  189. filter                     ds.l    1                ; offset: $2C (44)        ; filter to apply to sound
  190. moreRtn                     ds.l    1                ; offset: $30 (48)        ; routine to call to get more data
  191. completionRtn             ds.l    1                ; offset: $34 (52)        ; routine to call when buffer is complete
  192. refCon                     ds.l    1                ; offset: $38 (56)        ; user refcon
  193. result                     ds.w    1                ; offset: $3C (60)        ; result
  194. sizeof                     EQU *                    ; size:   $3E (62)
  195.                         ENDR
  196. ; private thing to reference a Sound Source
  197.  
  198.  
  199. ; typedef SoundSource *                    SoundSourcePtr
  200.  
  201. SoundComponentLink        RECORD 0
  202. description                 ds        ComponentDescription ; offset: $0 (0)    ; Describes the sound component
  203. mixerID                     ds.l    1                ; offset: $14 (20)        ; Reserved by Apple
  204. linkID                     ds.l    1                ; offset: $18 (24)        ; Reserved by Apple
  205. sizeof                     EQU *                    ; size:   $1C (28)
  206.                         ENDR
  207. ; typedef struct SoundComponentLink *    SoundComponentLinkPtr
  208.  
  209. AudioInfo                RECORD 0
  210. capabilitiesFlags         ds.l    1                ; offset: $0 (0)        ; Describes device capabilities
  211. reserved                 ds.l    1                ; offset: $4 (4)        ; Reserved by Apple
  212. numVolumeSteps             ds.w    1                ; offset: $8 (8)        ; Number of significant increments between min and max volume
  213. sizeof                     EQU *                    ; size:   $A (10)
  214.                         ENDR
  215. ; typedef struct AudioInfo *            AudioInfoPtr
  216.  
  217. ;
  218. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  219. ; functions for sound components
  220. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  221. ;Sound Component dispatch selectors
  222. ;
  223.  
  224. kSoundComponentInitOutputDeviceSelect EQU 1                    ;these calls cannot be delegated
  225. kSoundComponentSetSourceSelect    EQU        2
  226. kSoundComponentGetSourceSelect    EQU        3
  227. kSoundComponentGetSourceDataSelect EQU    4
  228. kSoundComponentSetOutputSelect    EQU        5
  229. kDelegatedSoundComponentSelectors EQU    $0100                ;first selector that can be delegated up the chain
  230.                                                             ;these calls can be delegated and have own range
  231. kSoundComponentAddSourceSelect    EQU        $0101
  232. kSoundComponentRemoveSourceSelect EQU    $0102
  233. kSoundComponentGetInfoSelect    EQU        $0103
  234. kSoundComponentSetInfoSelect    EQU        $0104
  235. kSoundComponentStartSourceSelect EQU    $0105
  236. kSoundComponentStopSourceSelect    EQU        $0106
  237. kSoundComponentPauseSourceSelect EQU    $0107
  238. kSoundComponentPlaySourceBufferSelect EQU $0108
  239.  
  240.                                                             ;Audio Component selectors
  241. kAudioGetVolumeSelect            EQU        0
  242. kAudioSetVolumeSelect            EQU        1
  243. kAudioGetMuteSelect                EQU        2
  244. kAudioSetMuteSelect                EQU        3
  245. kAudioSetToDefaultsSelect        EQU        4
  246. kAudioGetInfoSelect                EQU        5
  247. kAudioGetBassSelect                EQU        6
  248. kAudioSetBassSelect                EQU        7
  249. kAudioGetTrebleSelect            EQU        8
  250. kAudioSetTrebleSelect            EQU        9
  251. kAudioGetOutputDeviceSelect        EQU        10
  252. kAudioMuteOnEventSelect            EQU        129
  253. ;
  254. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  255. ; Sound Manager 3.0 utilities
  256. ;
  257. ;
  258. ; pascal OSErr OpenMixerSoundComponent(SoundComponentDataPtr outputDescription, long outputFlags, ComponentInstance *mixerComponent)
  259. ;
  260.     IF ¨ GENERATINGCFM THEN
  261.         Macro
  262.         _OpenMixerSoundComponent
  263.             move.l              #$06140018,D0
  264.             dc.w                $A800
  265.         EndM
  266.     ELSE
  267.         IMPORT_CFM_FUNCTION OpenMixerSoundComponent
  268.     ENDIF
  269.  
  270. ;
  271. ; pascal OSErr CloseMixerSoundComponent(ComponentInstance ci)
  272. ;
  273.     IF ¨ GENERATINGCFM THEN
  274.         Macro
  275.         _CloseMixerSoundComponent
  276.             move.l              #$02180018,D0
  277.             dc.w                $A800
  278.         EndM
  279.     ELSE
  280.         IMPORT_CFM_FUNCTION CloseMixerSoundComponent
  281.     ENDIF
  282.  
  283. ;
  284. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  285. ; basic sound component functions
  286. ;
  287. ;
  288. ; pascal ComponentResult SoundComponentInitOutputDevice(ComponentInstance ti, long actions)
  289. ;
  290.     IF ¨ GENERATINGCFM THEN
  291.         Macro
  292.         _SoundComponentInitOutputDevice
  293.             move.l              #$00040001,-(sp)
  294.             moveq               #0,D0
  295.             dc.w                $A82A
  296.         EndM
  297.     ELSE
  298.         IMPORT_CFM_FUNCTION SoundComponentInitOutputDevice
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal ComponentResult SoundComponentSetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance source)
  303. ;
  304.     IF ¨ GENERATINGCFM THEN
  305.         Macro
  306.         _SoundComponentSetSource
  307.             move.l              #$00080002,-(sp)
  308.             moveq               #0,D0
  309.             dc.w                $A82A
  310.         EndM
  311.     ELSE
  312.         IMPORT_CFM_FUNCTION SoundComponentSetSource
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal ComponentResult SoundComponentGetSource(ComponentInstance ti, SoundSource sourceID, ComponentInstance *source)
  317. ;
  318.     IF ¨ GENERATINGCFM THEN
  319.         Macro
  320.         _SoundComponentGetSource
  321.             move.l              #$00080003,-(sp)
  322.             moveq               #0,D0
  323.             dc.w                $A82A
  324.         EndM
  325.     ELSE
  326.         IMPORT_CFM_FUNCTION SoundComponentGetSource
  327.     ENDIF
  328.  
  329. ;
  330. ; pascal ComponentResult SoundComponentGetSourceData(ComponentInstance ti, SoundComponentDataPtr *sourceData)
  331. ;
  332.     IF ¨ GENERATINGCFM THEN
  333.         Macro
  334.         _SoundComponentGetSourceData
  335.             move.l              #$00040004,-(sp)
  336.             moveq               #0,D0
  337.             dc.w                $A82A
  338.         EndM
  339.     ELSE
  340.         IMPORT_CFM_FUNCTION SoundComponentGetSourceData
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal ComponentResult SoundComponentSetOutput(ComponentInstance ti, SoundComponentDataPtr requested, SoundComponentDataPtr *actual)
  345. ;
  346.     IF ¨ GENERATINGCFM THEN
  347.         Macro
  348.         _SoundComponentSetOutput
  349.             move.l              #$00080005,-(sp)
  350.             moveq               #0,D0
  351.             dc.w                $A82A
  352.         EndM
  353.     ELSE
  354.         IMPORT_CFM_FUNCTION SoundComponentSetOutput
  355.     ENDIF
  356.  
  357. ;
  358. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  359. ; junction methods for the mixer, must be called at non-interrupt level
  360. ;
  361. ;
  362. ; pascal ComponentResult SoundComponentAddSource(ComponentInstance ti, SoundSource *sourceID)
  363. ;
  364.     IF ¨ GENERATINGCFM THEN
  365.         Macro
  366.         _SoundComponentAddSource
  367.             move.l              #$00040101,-(sp)
  368.             moveq               #0,D0
  369.             dc.w                $A82A
  370.         EndM
  371.     ELSE
  372.         IMPORT_CFM_FUNCTION SoundComponentAddSource
  373.     ENDIF
  374.  
  375. ;
  376. ; pascal ComponentResult SoundComponentRemoveSource(ComponentInstance ti, SoundSource sourceID)
  377. ;
  378.     IF ¨ GENERATINGCFM THEN
  379.         Macro
  380.         _SoundComponentRemoveSource
  381.             move.l              #$00040102,-(sp)
  382.             moveq               #0,D0
  383.             dc.w                $A82A
  384.         EndM
  385.     ELSE
  386.         IMPORT_CFM_FUNCTION SoundComponentRemoveSource
  387.     ENDIF
  388.  
  389. ;
  390. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  391. ; info methods
  392. ;
  393. ;
  394. ; pascal ComponentResult SoundComponentGetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  395. ;
  396.     IF ¨ GENERATINGCFM THEN
  397.         Macro
  398.         _SoundComponentGetInfo
  399.             move.l              #$000C0103,-(sp)
  400.             moveq               #0,D0
  401.             dc.w                $A82A
  402.         EndM
  403.     ELSE
  404.         IMPORT_CFM_FUNCTION SoundComponentGetInfo
  405.     ENDIF
  406.  
  407. ;
  408. ; pascal ComponentResult SoundComponentSetInfo(ComponentInstance ti, SoundSource sourceID, OSType selector, void *infoPtr)
  409. ;
  410.     IF ¨ GENERATINGCFM THEN
  411.         Macro
  412.         _SoundComponentSetInfo
  413.             move.l              #$000C0104,-(sp)
  414.             moveq               #0,D0
  415.             dc.w                $A82A
  416.         EndM
  417.     ELSE
  418.         IMPORT_CFM_FUNCTION SoundComponentSetInfo
  419.     ENDIF
  420.  
  421. ;
  422. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  423. ; control methods
  424. ;
  425. ;
  426. ; pascal ComponentResult SoundComponentStartSource(ComponentInstance ti, short count, SoundSource *sources)
  427. ;
  428.     IF ¨ GENERATINGCFM THEN
  429.         Macro
  430.         _SoundComponentStartSource
  431.             move.l              #$00060105,-(sp)
  432.             moveq               #0,D0
  433.             dc.w                $A82A
  434.         EndM
  435.     ELSE
  436.         IMPORT_CFM_FUNCTION SoundComponentStartSource
  437.     ENDIF
  438.  
  439. ;
  440. ; pascal ComponentResult SoundComponentStopSource(ComponentInstance ti, short count, SoundSource *sources)
  441. ;
  442.     IF ¨ GENERATINGCFM THEN
  443.         Macro
  444.         _SoundComponentStopSource
  445.             move.l              #$00060106,-(sp)
  446.             moveq               #0,D0
  447.             dc.w                $A82A
  448.         EndM
  449.     ELSE
  450.         IMPORT_CFM_FUNCTION SoundComponentStopSource
  451.     ENDIF
  452.  
  453. ;
  454. ; pascal ComponentResult SoundComponentPauseSource(ComponentInstance ti, short count, SoundSource *sources)
  455. ;
  456.     IF ¨ GENERATINGCFM THEN
  457.         Macro
  458.         _SoundComponentPauseSource
  459.             move.l              #$00060107,-(sp)
  460.             moveq               #0,D0
  461.             dc.w                $A82A
  462.         EndM
  463.     ELSE
  464.         IMPORT_CFM_FUNCTION SoundComponentPauseSource
  465.     ENDIF
  466.  
  467. ;
  468. ; pascal ComponentResult SoundComponentPlaySourceBuffer(ComponentInstance ti, SoundSource sourceID, SoundParamBlockPtr pb, long actions)
  469. ;
  470.     IF ¨ GENERATINGCFM THEN
  471.         Macro
  472.         _SoundComponentPlaySourceBuffer
  473.             move.l              #$000C0108,-(sp)
  474.             moveq               #0,D0
  475.             dc.w                $A82A
  476.         EndM
  477.     ELSE
  478.         IMPORT_CFM_FUNCTION SoundComponentPlaySourceBuffer
  479.     ENDIF
  480.  
  481. ;
  482. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  483. ; interface for Audio Components
  484. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  485. ;
  486. ;
  487. ;Volume is described as a value between 0 and 1, with 0 indicating minimum
  488. ;  volume and 1 indicating maximum volume; if the device doesn't support
  489. ;  software control of volume, then a value of unimpErr is returned, indicating
  490. ;  that these functions are not supported by the device
  491. ;
  492. ;
  493. ; pascal ComponentResult AudioGetVolume(ComponentInstance ac, short whichChannel, ShortFixed *volume)
  494. ;
  495.     IF ¨ GENERATINGCFM THEN
  496.         Macro
  497.         _AudioGetVolume
  498.             move.l              #$00060000,-(sp)
  499.             moveq               #0,D0
  500.             dc.w                $A82A
  501.         EndM
  502.     ELSE
  503.         IMPORT_CFM_FUNCTION AudioGetVolume
  504.     ENDIF
  505.  
  506. ;
  507. ; pascal ComponentResult AudioSetVolume(ComponentInstance ac, short whichChannel, ShortFixed volume)
  508. ;
  509.     IF ¨ GENERATINGCFM THEN
  510.         Macro
  511.         _AudioSetVolume
  512.             move.l              #$00040001,-(sp)
  513.             moveq               #0,D0
  514.             dc.w                $A82A
  515.         EndM
  516.     ELSE
  517.         IMPORT_CFM_FUNCTION AudioSetVolume
  518.     ENDIF
  519.  
  520. ;
  521. ;If the device doesn't support software control of mute, then a value of unimpErr is
  522. ;returned, indicating that these functions are not supported by the device.
  523. ;
  524. ;
  525. ; pascal ComponentResult AudioGetMute(ComponentInstance ac, short whichChannel, short *mute)
  526. ;
  527.     IF ¨ GENERATINGCFM THEN
  528.         Macro
  529.         _AudioGetMute
  530.             move.l              #$00060002,-(sp)
  531.             moveq               #0,D0
  532.             dc.w                $A82A
  533.         EndM
  534.     ELSE
  535.         IMPORT_CFM_FUNCTION AudioGetMute
  536.     ENDIF
  537.  
  538. ;
  539. ; pascal ComponentResult AudioSetMute(ComponentInstance ac, short whichChannel, short mute)
  540. ;
  541.     IF ¨ GENERATINGCFM THEN
  542.         Macro
  543.         _AudioSetMute
  544.             move.l              #$00040003,-(sp)
  545.             moveq               #0,D0
  546.             dc.w                $A82A
  547.         EndM
  548.     ELSE
  549.         IMPORT_CFM_FUNCTION AudioSetMute
  550.     ENDIF
  551.  
  552. ;
  553. ;AudioSetToDefaults causes the associated device to reset its volume and mute values
  554. ;(and perhaps other characteristics, e.g. attenuation) to "factory default" settings
  555. ;
  556. ;
  557. ; pascal ComponentResult AudioSetToDefaults(ComponentInstance ac)
  558. ;
  559.     IF ¨ GENERATINGCFM THEN
  560.         Macro
  561.         _AudioSetToDefaults
  562.             move.l              #$00000004,-(sp)
  563.             moveq               #0,D0
  564.             dc.w                $A82A
  565.         EndM
  566.     ELSE
  567.         IMPORT_CFM_FUNCTION AudioSetToDefaults
  568.     ENDIF
  569.  
  570. ; This routine is required; it must be implemented by all audio components
  571. ;
  572. ; pascal ComponentResult AudioGetInfo(ComponentInstance ac, AudioInfoPtr info)
  573. ;
  574.     IF ¨ GENERATINGCFM THEN
  575.         Macro
  576.         _AudioGetInfo
  577.             move.l              #$00040005,-(sp)
  578.             moveq               #0,D0
  579.             dc.w                $A82A
  580.         EndM
  581.     ELSE
  582.         IMPORT_CFM_FUNCTION AudioGetInfo
  583.     ENDIF
  584.  
  585. ;
  586. ; pascal ComponentResult AudioGetBass(ComponentInstance ac, short whichChannel, short *bass)
  587. ;
  588.     IF ¨ GENERATINGCFM THEN
  589.         Macro
  590.         _AudioGetBass
  591.             move.l              #$00060006,-(sp)
  592.             moveq               #0,D0
  593.             dc.w                $A82A
  594.         EndM
  595.     ELSE
  596.         IMPORT_CFM_FUNCTION AudioGetBass
  597.     ENDIF
  598.  
  599. ;
  600. ; pascal ComponentResult AudioSetBass(ComponentInstance ac, short whichChannel, short bass)
  601. ;
  602.     IF ¨ GENERATINGCFM THEN
  603.         Macro
  604.         _AudioSetBass
  605.             move.l              #$00040007,-(sp)
  606.             moveq               #0,D0
  607.             dc.w                $A82A
  608.         EndM
  609.     ELSE
  610.         IMPORT_CFM_FUNCTION AudioSetBass
  611.     ENDIF
  612.  
  613. ;
  614. ; pascal ComponentResult AudioGetTreble(ComponentInstance ac, short whichChannel, short *Treble)
  615. ;
  616.     IF ¨ GENERATINGCFM THEN
  617.         Macro
  618.         _AudioGetTreble
  619.             move.l              #$00060008,-(sp)
  620.             moveq               #0,D0
  621.             dc.w                $A82A
  622.         EndM
  623.     ELSE
  624.         IMPORT_CFM_FUNCTION AudioGetTreble
  625.     ENDIF
  626.  
  627. ;
  628. ; pascal ComponentResult AudioSetTreble(ComponentInstance ac, short whichChannel, short Treble)
  629. ;
  630.     IF ¨ GENERATINGCFM THEN
  631.         Macro
  632.         _AudioSetTreble
  633.             move.l              #$00040009,-(sp)
  634.             moveq               #0,D0
  635.             dc.w                $A82A
  636.         EndM
  637.     ELSE
  638.         IMPORT_CFM_FUNCTION AudioSetTreble
  639.     ENDIF
  640.  
  641. ;
  642. ; pascal ComponentResult AudioGetOutputDevice(ComponentInstance ac, Component *outputDevice)
  643. ;
  644.     IF ¨ GENERATINGCFM THEN
  645.         Macro
  646.         _AudioGetOutputDevice
  647.             move.l              #$0004000A,-(sp)
  648.             moveq               #0,D0
  649.             dc.w                $A82A
  650.         EndM
  651.     ELSE
  652.         IMPORT_CFM_FUNCTION AudioGetOutputDevice
  653.     ENDIF
  654.  
  655. ; This is routine is private to the AudioVision component.  It enables the watching of the mute key.
  656. ;
  657. ; pascal ComponentResult AudioMuteOnEvent(ComponentInstance ac, short muteOnEvent)
  658. ;
  659.     IF ¨ GENERATINGCFM THEN
  660.         Macro
  661.         _AudioMuteOnEvent
  662.             move.l              #$00020081,-(sp)
  663.             moveq               #0,D0
  664.             dc.w                $A82A
  665.         EndM
  666.     ELSE
  667.         IMPORT_CFM_FUNCTION AudioMuteOnEvent
  668.     ENDIF
  669.  
  670.     ENDIF
  671.     ENDIF ; __SOUNDCOMPONENTS__ 
  672.  
  673.